<?php
//易支付 通用接口
Route::group(
    [
        'middleware' => 'api',
        'prefix' => 'api/easypay',
        'namespace' => 'Summer\Easypay\Http\Controllers',
    ],
    function () {
        //不需要登录到接口,原则是和用户无关到信息都不加auth
        //【易支付】支付宝支付链接
        Route::get(
            'index/alipayPay/{sn}',
            'IndexController@alipayPay'
        )->name('api.easypay.index.alipayPay');
        //【易支付】支付宝回调
        Route::post(
            'index/alipayNotify',
            'IndexController@alipayNotify'
        )->name('api.easypay.index.alipayNotify');
        //【易支付】微信回调
        Route::post(
            'index/wechatNotify',
            'IndexController@wechatNotify'
        )->name('api.easypay.index.wechatNotify');
        //需要登录次能显示
        Route::middleware(['Summer\Hub\Http\Middleware\HubJwtAuthMiddleware'])->group(
            function () {
                //【易支付】获取支付方式
                Route::post(
                    'index/getPayment',
                    'IndexController@getPayment'
                )->name('api.easypay.index.getPayment');
                //【易支付】支付
                Route::post(
                    'index/prepay',
                    'IndexController@prepay'
                )->name('api.easypay.index.prepay');
            }
        );

    }
);




